package com.hqd.ch03.test.web.v34;


import com.hqd.ch03.v34.context.stereotype.Controller;
import com.hqd.ch03.v34.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String sayHello(HttpServletRequest req, HttpServletResponse resp, String str) {
        String key = "message";
        String message = (String) req.getAttribute(key);
        if (message == null) {
            message = "";
        }
        req.setAttribute(key, message + " V34 HandleMapping! " + str);
        return "hello";
    }
}
